<template>
	<view class="displacesProducts">
		<view class="navigation">
			<image src="/static/images/collage/collage-back.png" class="collage-back" @click="back()" mode=""></image>
			<view class="navigation-title">提货专区</view>
		</view>
		<view class="displaces-products-list">
			<view class="collages-goods-list-item" v-for="(item,index) in pageItems" :key="index" @click="goCollageGoodsDetail(item.id)">
				<image :src="item.cover_url" class="goods-icon" mode=""></image>
				<view class="collages-goods-list-item-right">
					<view class="goods-describe">{{ item.title }}</view>
					<view class="goods-other-lable">
						<image src="/static/images/collage/free-post.png" v-if="item.is_sf" class="free-post" mode=""></image>
						<image src="/static/images/collage/product-hangkong.png" v-if="item.is_hongkong_direct" class="free-post" mode=""></image>
						<image src="/static/images/collage/product-hangkong.png" v-if="item.is_overseas_direct" class="free-post" mode=""></image>
						<image src="/static/images/collage/high-recommend.png" v-if="item.is_pop" class="high-recommend" mode=""></image>
					</view>
					<view class="deliver-goods-address">保税仓发货</view>
					<view class="goods-num-info">
						<view class="goods-money">
							<text>￥</text>
							<text>{{ item.price_lowest }}</text>
						</view>
						<view class="goods-solded-num">已售{{ item.sold_count }}件</view>
					</view>
				</view>
				<image src="/static/images/collage/collages-icon.png" class="collages-icon" mode=""></image>
			</view>
		</view>
	</view>
</template>

<script>
	import { getOrderDisplacesProducts } from 'api/collageApi'
	import Pagination from "mixins/Pagination"
	export default {
		mixins:[
			Pagination
		],
		data() {
			return {
				displaces_id:null
			}
		},
		methods:{
			back(){
				uni.navigateBack({})
			},
			goCollageGoodsDetail(id){
				uni.navigateTo({url: '/packs/pages/collageGoodsDetail/collageGoodsDetail?id=' + id + '&from=displaces'})
			},
			async loadPageItems() {
				return await getOrderDisplacesProducts(this.displaces_id,{page: this.pageNumber})
			}
		},
		async onLoad(opitions) {
			this.displaces_id = opitions.id;
			await this.loadPageData()
		}
		
	}
</script>

<style scoped lang="scss">
	page{
		background: #F6F6F6;
	}
	.displacesProducts{
		padding-top: 140rpx;
	}
	.navigation{
		width: 100%;
		height: 100rpx;
		background: rgba(0,0,0,0);
		display: flex;
		align-items: center;
		justify-content: center;
		position: fixed;
		left:0;
		top:0;
		z-index:999;
	}
	.collage-back{
		display: block;
		width: 48rpx;
		height: 48rpx;
		position: absolute;
		top: 26rpx;
		left: 32rpx;
	}
	.navigation-title{
		font-size: 32rpx;
		font-weight: 500;
		color: #333333;
	}

	.collages-goods-list-item{
		width: 686rpx;
		height: 232rpx;
		background: #FFFFFF;
		border-radius: 32rpx;
		margin:0 auto 16rpx;
		display: flex;
		position: relative;
		.goods-icon{
			display:block;
			width: 232rpx;
			height: 232rpx;
			border-radius: 32rpx 0px 0px 32rpx;
		}
		.collages-goods-list-item-right{
			margin:16rpx 0 0 24rpx;
		}
		.goods-describe{
			width: 406rpx;
			height: 80rpx;
			font-size: 28rpx;
			font-weight: 400;
			color: #333333;
			line-height: 40rpx;
			display: -webkit-box;
			-webkit-box-orient: vertical;
			-webkit-line-clamp: 2;
			overflow: hidden;
		}
		.goods-other-lable{
			display: flex;
			align-items: center;
			margin-top: 4rpx;
		}
		.free-post,.high-recommend{
			display: block;
			width: 102rpx;
			height: 30rpx;
			margin-right: 8rpx;
		}
		.deliver-goods-address{
			font-size: 24rpx;
			font-weight: 400;
			color: #999999;
			line-height: 34rpx;
			margin-top: 4rpx;
		}
		.goods-num-info{
			display: flex;
		}
		.goods-money{
			>text:nth-child(1){
				font-size: 24rpx;
				font-weight: 400;
				color: #FF4416;
				line-height: 34rpx;
			}
			>text:nth-child(2){
				font-size: 36rpx;
				font-family: PingFangSC-Semibold, PingFang SC;
				font-weight: 600;
				color: #FF4416;
				line-height: 50rpx;
			}
		}
		.goods-solded-num{
			font-size: 24rpx;
			font-weight: 400;
			color: #999999;
			line-height: 34rpx;
			margin:12rpx 0 0 24rpx;
		}
		.collages-icon{
			display: block;
			width: 114rpx;
			height: 96rpx;
			position: absolute;
			bottom: 0;
			right: 0;
		}
	}
</style>
